package br.ufpe.cin.analysis.plugin.charts;

import java.io.IOException;

import javax.xml.bind.JAXBException;

import org.jfree.chart.ChartFactory;

import br.ufpe.cin.analysis.plugin.models.PieDataset;
import br.ufpe.cin.analysis.plugin.entities.Process;


public class PieChart extends Chart<PieDataset> {
	
	
	public PieChart(PieDataset dataset)
	{
		this.setDataset(dataset);
	}
	
	public PieChart(String xmlFileName) throws JAXBException, IOException
	{
		this.setDataset(new PieDataset(xmlFileName));
	}
	
	public PieChart(Process process)
	{
		this.setDataset(new PieDataset(process));
	}
	
	
	@Override
	public void init() {
		
		this.setJChart( ChartFactory.createPieChart(this.getDataset().getProcess().getName(), this.getDataset().getJFreeChartDataset(), true, true, true));

	}

}
